Imports Clo = Enhancements.Core.Logging
Imports Fun = Enhancements.Basic.Expressions.Functions
Imports Ref = System.Reflection
Imports Sys = System

Namespace Enhancements.Basic.Expressions
    ''' <summary>The exception that is thrown when an expression contains undetermined tokens.</summary>
    <Serializable(), DebuggerStepThrough()> _
    Public NotInheritable Class CompilerExpressionHasUndeterminedTokensException
        Inherits CompilerException

        Private Sub New(ByVal _expression As System.String, ByVal _undeterminedTokens() As Undetermined)
            Expression = _expression
            UndeterminedTokens = _undeterminedTokens
        End Sub

        Private __Expression As System.String = Nothing
        ''' <summary>Gets the expression that caused this exception.</summary>
        Public Property Expression() As System.String
            Get
                Return __Expression
            End Get
            Private Set(ByVal _value As System.String)
                __Expression = _value
            End Set
        End Property

        Private __UndeterminedTokens() As Undetermined = Nothing
        ''' <summary>Gets the tokens that caused this exception.</summary>
        Public Property UndeterminedTokens() As Undetermined()
            Get
                Return __UndeterminedTokens
            End Get
            Private Set(ByVal _value() As Undetermined)
                __UndeterminedTokens = _value
            End Set
        End Property

        ''' <summary>Throws an exception.</summary>
        ''' <param name="_expression">Expression that is causing the exception.</param>
        ''' <param name="_undeterminedTokens">Undetermined tokens that are causing the exception.</param>
        ''' <exception cref="CompilerExpressionHasUndeterminedTokensException"> </exception>
        Friend Shared Sub ___Throw(ByVal _expression As System.String, ByVal _undeterminedTokens() As Undetermined)
            Dim _exception As CompilerExpressionHasUndeterminedTokensException = New CompilerExpressionHasUndeterminedTokensException(_expression, _undeterminedTokens)

            Throw _exception
        End Sub

    End Class
End Namespace
